<?php
/**
 * Created by phpstrom.
 * User:wangyahe
 * Date: 2017/7/11
 * Time: 14:50
 */

namespace app\admin\validate;


use think\Validate;

class Goods extends Validate
{

	//验证规则
	protected $rule=[
		'goods_name'=>'require',
		'cate_id'=>'require',
		'goods_sprice'=>'require',
		'goods_mprice'=>'require',
		'goods_num'=>'require|number|in:100,200,300',
		'goods_color'=>'require',
		'goods_size'=>'require',
		'goods_createtime'=>'require',
		'goods_thumb'=>'require',
		'goods_pics'=>'require',
		'goods_details'=>'require',
//		'goods_isrecycle'=>'require',

	];
	//验证的提示消息
	protected $message=[
		'goods_name.require'=>'商品名称不能为空',
		'cate_id.require'=>'请选择所属分类',
		'goods_sprice.require'=>'请填写商品的市场价',
		'goods_mprice.require'=>'请填写商品的商城价',
		'goods_num.require'=>'请填写商品的数量',
		'goods_num.number'=>'商品的库存数量只能为数字',
		'goods_num.in'=>'商品的库存数量只能在100,200,300之间的数量',
		'goods_color.require'=>'请选择商品的颜色',
		'goods_size.require'=>'请填写商品的尺寸',
		'goods_createtime.require'=>'请填写商品的上架时间',
		'goods_thumb.require'=>'请上传商品的列表大图',
		'goods_pics.require'=>'请上传商品的图册',
		'goods_details.require'=>'请填写商品的详情',
//		'goods_isrecycle.require'=>'请填写是否放到回收站中',
	];

}